
#ifndef __ECDSA_KEYPAIR_GENERATOR_H
#define __ECDSA_KEYPAIR_GENERATOR_H

#include "ECDSAPublicKey.h"
#include "ECDSAPrivateKey.h"

/** An ECDSA key pair generator. */
class ECDSAKeyPairGenerator
{
   public:
      ECDSAKeyPairGenerator(int nbits, const char *name);
      ~ECDSAKeyPairGenerator();
      int checkAreKeyPair();
      static int checkAreKeyPair(ECDSAPublicKey *ipub, ECDSAPrivateKey *iprv);
      ECDSAPublicKey *getPublicKey();
      ECDSAPrivateKey *getPrivateKey();
      ECDSAPublicKey *popPublicKey();
      ECDSAPrivateKey *popPrivateKey();
   private:
      /** Generate key pair into the ECDSAPublicKey and ECDSAPrivateKey classes. */
      int generateKeyPair(int nbits, const char *name);
      /** Pointer to the ECDSA public key. */
      ECDSAPublicKey *pub;
      /** Pointer to the ECDSA private key. */
      ECDSAPrivateKey *prv;
};

#endif
